<template>
    <div>
      <CustomForm 
        :customFields="registerClientFields" :handleSubmit="submit"
      />
    </div>

  </template>
  
  <script setup lang="ts">
  import { ref } from 'vue';
  import CustomForm from './basicForm.vue';
  import { GoPageName, Icons } from "@/enums/index.ts";
  // 提交注册的处理函数
  const submit = async (_formData: any) => {
  return Promise.resolve();
};

  // 注册表单配置
  const registerClientFields = ref({
    title: '咨询者注册',
    btnTitle: "注册",
    type: GoPageName.REGISTERCLIENT,
    inputData: [
      {
        lable: "name",
        value: "",
        inputPlaceholder: '请输入姓名',
        type: "text",
        icon: Icons.USER
      },
      {
        lable: "gender",
        value: "",
        inputPlaceholder: '请输入性别',
        type: "text",
        icon: Icons.VERIFY
      },
      {
        lable: "mobile",
        value: "",
        inputPlaceholder: '请输入手机号',
        type: "tel",
        icon: Icons.IPHONE
      },
      {
        lable : "email",
        value: "",
        inputPlaceholder: '请输入邮箱',
        type: "text",
        icon: Icons.VERIFY
      },
      {
        lable: "inputPassword",
        value: "",
        inputPlaceholder: '请输入密码',
        type: "password",
        icon: Icons.LOCK
      },
      {
        lable: "ConfirmPassword",
        value: "",
        inputPlaceholder: '请确认密码',
        type: "password",
        icon: Icons.LOCK
      },
    ],
    rules: [
      [{ required: true, message: '请输入姓名', trigger: 'blur' }],
      [{ required: true, message: '请输入性别', trigger: 'change' }],
      [{ required: true, message: '请检查手机号，并重新输入', trigger: 'blur' }],
      [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
      [{ required: true, message: '请输入密码', trigger: 'blur' }],
      [{ required: true, message: '请确认密码', trigger: 'blur' }],
    ],
  });
  </script>

  